import request from '@/utils/request' // 导入封装请求的js文件

export function selectPage (params) {
  return request({
    url: '/Advertisement/selectPage',
    method: 'get',
    params: params
  })
}
// 编辑广告信息
export function updateAdvertisement (params) {
  return request({
    url: '/Advertisement/updateAdvertisement',
    method: 'PUT',
    data: params
  })
}
// 批量编辑广告信息
export function updateBatchAdvertisement (params, ids) {
  return request({
    url: `/Advertisement/updateBatchAdvertisement?adPositonList=${ids}`,
    method: 'PUT',
    data: params
  })
}
// 获取广告详情
export function selectAdInfoByPosition (params, ids) {
  return request({
    url: '/Advertisement/selectAdInfoByPosition',
    method: 'GET',
    params: params
  })
}
// 获取商品列表
export function selectAllByParams (params) {
  return request({
    url: '/pmsProduct/selectAllByParams',
    method: 'get',
    params: params
  })
}
// 获取广告配置详情
export function selectMyAdByPosition (params, ids) {
  return request({
    url: '/Advertisement/selectMyAdByPosition',
    method: 'GET',
    params: params
  })
}
// 配置广告
export function setAdvertisementInfo (params) {
  return request({
    url: '/Advertisement/setAdvertisementInfo',
    method: 'PUT',
    data: params
  })
}
// 获取所有店铺
export function selectAllStore (params, ids) {
  return request({
    url: '/pmsStore/selectAllStore',
    method: 'GET',
    params: params
  })
}
// 删除广告中的商品
export function deleteAdvertisementInfo (params, ids) {
  return request({
    url: '/Advertisement/deleteAdvertisementInfo',
    method: 'DELETE',
    params: params
  })
}
